package com.wishwall.beans;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonView;

import com.wishwall.resources.views.JsonViews;

/**
 * The persistent class for the t_device database table.
 *
 */
@Entity
@Table(name = "T_DEVICE")
public class DeviceBean implements Serializable {

	private static final long serialVersionUID = 7856170870959160920L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="PK_DEVICE_ID")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private Integer id;

	@Column(name="DEVICE_UID")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String deviceUid = null;

	@Column(name="DEVICE_MODEL")
	@JsonProperty
	@JsonView(JsonViews.Basic.class)
	private String deviceModel = null;

	@Column(name="NOTIFICATION_ID")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String notificationId = null;

	@Column(name="MANUFACTURER")
	@JsonProperty
	@JsonView(JsonViews.Basic.class)
	private String manufacturer = null;

	@Column(name="DEVICE_NAME")
	@JsonProperty
	@JsonView(JsonViews.Basic.class)
	private String deviceName = null;

	@Column(name="DATE_REGISTRED")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private Timestamp dateRegistred = null;

	@Column(name="LAST_MODIFIED")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private Timestamp lastModifiedDate = null;

	@Column(name="DEVICE_OS")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String deviceOS  = null;

	@Column(name="OS_VERSION")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String osVersion = null;

	@Column(name="COUNTRY")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String country = null;

	@Column(name="TIME_ZONE")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private String timeZone = null;

	@Column(name="FK_BRAND_ID")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private Integer brandId = null;

	@Column(name="FK_PLATFORM_ID")
	@JsonProperty
	@JsonView(JsonViews.All.class)
	private Integer platformId = null;

	/**
	 * 
	 * @return
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * 
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 
	 * @return
	 */
	public String getDeviceModel() {
		return deviceModel;
	}

	/**
	 * 
	 * @param deviceModel
	 */
	public void setDeviceModel(String deviceModel) {
		this.deviceModel = deviceModel;
	}

	/**
	 * 
	 * @return
	 */
	public String getManufacturer() {
		return manufacturer;
	}

	/**
	 * 
	 * @param manufacturer
	 */
	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}

	/**
	 * 
	 * @return
	 */
	public String getDeviceName() {
		return deviceName;
	}

	/**
	 * 
	 * @param deviceName
	 */
	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}

	/**
	 * 
	 * @return
	 */
	public Timestamp getDateRegistred() {
		return dateRegistred;
	}

	/**
	 * 
	 * @param dateRegistred
	 */
	public void setDateRegistred(Timestamp dateRegistred) {
		this.dateRegistred = dateRegistred;
	}

	/**
	 * 
	 * @return
	 */
	public Timestamp getLastModifiedDate() {
		return lastModifiedDate;
	}

	/**
	 * 
	 * @param lastModifiedDate
	 */
	public void setLastModifiedDate(Timestamp lastModifiedDate) {
		this.lastModifiedDate = lastModifiedDate;
	}

	/**
	 * 
	 * @return
	 */
	public String getDeviceOS() {
		return deviceOS;
	}

	/**
	 * 
	 * @param deviceOS
	 */
	public void setDeviceOS(String deviceOS) {
		this.deviceOS = deviceOS;
	}

	/**
	 * 
	 * @return
	 */
	public String getOsVersion() {
		return osVersion;
	}

	/**
	 * 
	 * @param osVersion
	 */
	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	/**
	 * 
	 * @return
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * 
	 * @param country
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * 
	 * @return
	 */
	public String getTimeZone() {
		return timeZone;
	}

	/**
	 * 
	 * @param timeZone
	 */
	public void setTimeZone(String timeZone) {
		this.timeZone = timeZone;
	}

	/**
	 * 
	 * @return
	 */
	public Integer getBrandId() {
		return brandId;
	}

	/**
	 * 
	 * @param brandId
	 */
	public void setBrandId(Integer brandId) {
		this.brandId = brandId;
	}

	/**
	 * 
	 * @return
	 */
	public Integer getPlatformId() {
		return platformId;
	}

	/**
	 * 
	 * @param platformId
	 */
	public void setPlatformId(Integer platformId) {
		this.platformId = platformId;
	}

	/**
	 * 
	 * @return
	 */
	public String getDeviceUid() {
		return deviceUid;
	}

	/**
	 * 
	 * @param deviceUid
	 */
	public void setDeviceUid(String deviceUid) {
		this.deviceUid = deviceUid;
	}

	/**
	 * 
	 * @return
	 */
	public String getNotificationId() {
		return notificationId;
	}

	/**
	 * 
	 * @param notificationId
	 */
	public void setNotificationId(String notificationId) {
		this.notificationId = notificationId;
	}

	@Override
	public int hashCode() {

		if (id != null) {
			return id.hashCode();
		}

		return super.hashCode();
	}

	@Override
	public boolean equals(Object obj) {

		if (obj == null) {
			return false;
		}

		if(this == obj) {
			return true;
		}

		if (!(obj instanceof DeviceBean)) {
			return false;
		}

		DeviceBean other = (DeviceBean) obj;
		if ((id == null) || (other.getId() == null)) {
			return false;
		}

		return (id.equals(other.getId()));
	}

}
